#ifndef ASYNC_SERVICE_INTERFACE_H
#define ASYNC_SERVICE_INTERFACE_H

#include <connection\message.h>
#include <connection\async_client.h>
#include <boost\shared_ptr.hpp>

namespace service
{
	class async_service_interface
	{
	public:
		async_service_interface();
		virtual void dispatch_callback(cs::message_handle msg) = 0;
		virtual ~async_service_interface(){}
	protected:
		typedef boost::shared_ptr<cs::async_client> client_t;
		client_t client;
	};

	//implementation

	async_service_interface::async_service_interface()
	{
		client.reset(new cs::async_client(
			boost::bind(&async_service_interface::dispatch_callback, this, _1)));
	}
} //end service

#endif //ASYNC_SERVICE_INTERFACE_H